package com.xsp.mybatisxmlsqlparser.multidatabase;

import lombok.Getter;

@Getter
public enum DataBasesTypeEnum {

    MYSQL("Mysql", "mysql", "MySql数据库"),
    ORACLE("Oracle", "Oracle", "oracle"),
    POSTGRE_SQL("Postgresql", "Postgresql", "Postgre数据库"),
    KINGBASE_ES("KingbaseES", "kingbase", "人大金仓数据库"),
    SQL_SERVER("sqlserver", "sqlserver", "SQLServer数据库"),
    GAUSS("zenith", "zenith", "Gauss 数据库"),
    DM("DM_DBMS", "dm", "达梦数据库");

    private String db;
    private String name;
    private String description;

    DataBasesTypeEnum(String db, String name, String description) {
        this.db = db;
        this.name = name;
        this.description = description;
    }

    public static DataBasesTypeEnum getEnum(String description) {
        for (DataBasesTypeEnum dataBasesTypeEnum : DataBasesTypeEnum.values()) {
            if (dataBasesTypeEnum.getDescription().equals(description)) {
                return dataBasesTypeEnum;
            }
        }
        return null;
    }
}
